/**
 * \* Created with IntelliJ IDEA.
 * \* User: 冯若航
 * \* Date: 2021/5/11
 * \* Time: 19:31
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class 替换空格 {
    public String replaceSpace(String s){
        StringBuilder res=new StringBuilder();
        for(Character c:s.toCharArray()){
            if(c==' '){
                res.append("%20");
            }else{
                res.append(c);
            }
        }
        return res.toString();
    }
}